#coding=utf-8
from socket import *
myhost=''
myport=8080
#ip+port 确定互联网中唯一的进程
#服务器
socketobj = socket(AF_INET,SOCK_STREAM)
socketobj.bind((myhost,myport))
socketobj.listen(128)
while True:
    connection,address = socketobj.accept()
    print 'connect by',address
    data = connection.recv(1024)
    connection.send('echo:'+data)
	#while True:
		#data = connection.recv(1024)
		#if not data:
			#break
		#connection.send('echo:'+data)
    connection.close()